---
export interface Props {
	class?: string
	href?: string
}

const { class: class_, href } = Astro.props

const _class = `btn${class_ ? " " + class_ : ""}`
---

{
	href ? (
		<a href={href} class={_class}>
			<slot />
		</a>
	) : (
		<button class={_class}>
			<slot />
		</button>
	)
}

<style>
	.btn {
		display: inline-block;
		margin-bottom: 1rem;
		color: rgba(255, 255, 255, 0.7);
		background-color: rgba(255, 255, 255, 0.08);
		border-color: rgba(255, 255, 255, 0.2);
		border-style: solid;
		border-width: 1px;
		border-radius: 0.3rem;
		transition: color 0.2s, background-color 0.2s, border-color 0.2s;
		text-decoration: none;
		&:hover {
			color: rgba(255, 255, 255, 0.8);
			text-decoration: none !important;
			background-color: rgba(255, 255, 255, 0.2);
			border-color: rgba(255, 255, 255, 0.3);
		}
	}
	@media screen and (min-width: 64em) {
		.btn {
			padding: 0.75rem 1rem;
		}
	}
	@media screen and (min-width: 42em) and (max-width: 64em) {
		.btn {
			padding: 0.6rem 0.9rem;
			font-size: 0.9rem;
		}
	}
	@media screen and (max-width: 42em) {
		.btn {
			display: block;
			padding: 0.75rem;
			font-size: 0.9rem;
		}
	}
</style>
